package com.softa.common.sysconfig.config;

import com.softa.common.sysconfig.shiro.tags.ShiroTags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * Created by yangl on 2018/5/28.
 */
@SuppressWarnings("ALL")
@Configuration
public class FreeMarkerConfig {

    @Autowired
    private freemarker.template.Configuration config;

    @PostConstruct
    public void setSharedVariable() {
        try {
            config.setSharedVariable("shiro", new ShiroTags());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
